(function () {
    var core = ecui,
        util = core.util,
        dom = ecui.dom;

    ecui.util.extend(NS.ui, {
    });
    ecui.esr.addRoute('detail', {
        model: [
            'entry@GET /erp-management/play/h5/entry-detail/${id}/1',
            'notentry@GET /erp-management/play/h5/entry-detail/${id}/0'
        ],
        weight: 3,
        main: 'ticket_detail',
        view: 'detail',
        frame: true,
        onbeforerequest: function (context) {

        },
        onbeforerender: function (context) {
            context.entryAcount = 0;
            context.notentryAcount = 0;
            context.entry.forEach(function (item) {
                context.entryAcount += item.total;
            });
            context.notentry.forEach(function (item) {
                context.notentryAcount += item.total;
            });
            context.iosVersion = /(iPhone|iPad).*?OS (\d+(_\d+)?)/i.test(navigator.userAgent) ?  +(RegExp.$2.replace('_', '.')) : undefined;
        },
        onafterrender: function (context) {
            // ecui.dispatchEvent(ecui.get('perform-check-list-view'), 'refresh');
        }
    });
}());